package com.tanhua.server.controller;

import com.tanhua.model.vo.PageResult;
import com.tanhua.model.vo.RecommendUserDto;
import com.tanhua.model.vo.TodayBest;
import com.tanhua.server.service.TodayBestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tanhua")
public class TanhuaController {

    @Autowired
    private TodayBestService todayBestService;

    /**
     * 12、今日佳人——查询最高分
     * /todayBest   Get
     *
     * @return TodayBest
     */
    @GetMapping("/todayBest")
    public ResponseEntity todayBest() {
        TodayBest vo = todayBestService.todayBest();
        return ResponseEntity.ok(vo);
    }

    /**
     * 13、今日佳人——分页查询推荐的用户列表
     * GET    /tanhua/recommendation
     * 请求参数：RecommendUserDto
     * 返回值：
     * PageResult<TodayBest>
     */
    @GetMapping("/recommendation")
    public ResponseEntity recommendation(RecommendUserDto dto) {
        PageResult result = todayBestService.recommendation(dto);
        return ResponseEntity.ok(result);
    }
}